package com.yc.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MyIndexAction {

    @RequestMapping("hello1")
    @ResponseBody //返回值为json
    String hello(String name){return "hello"+name;}

    @RequestMapping("toPage1")
    String toPage(String page){
        page = page == null ? "A" :page;
        return "redirect:" +page + ".html";
    }
}
